import requests
import json

item_url = 'https://game.gtimg.cn/images/lol/act/img/js/items/items.js?ts=2883760'

headers = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
}

item_response = requests.get(url=item_url, headers=headers)
item_json_obj = json.loads(item_response.text)
cnt = 0
for item in item_json_obj['items']:
    # 依次提取每件装备的信息
    itemId = item['itemId']
    name = item['name']
    price = item['price']
    maps = item['maps']
    keywords = item['keywords']
    item_desc = item['item_desc'].replace("\n", " ")
    cnt += 1
    print(cnt, itemId, name, price, maps, keywords, item_desc)
